
"""
Created on Tue Feb 19 14:55:43 2013

@author: aponteeduarddo@gmail.com
Copyright Eduardo Aponte 2013.
"""

from mex_binder import binder_py

eyelink_data_stop = binder_py('mx_eyelink_data_stop')
eyelink_data_stop.mx_c.headers = ['<eyelink.h>','"mex.h"']
eyelink_data_stop.bindo += []
eyelink_data_stop.mx_c.code = \
"""
INT16 _main( void )
{
    return eyelink_data_stop( );
}

void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
    double *status;
    mwSize td[2] = {1,1};
        
    /* Verify input arguments. */
    if(nrhs != 0 ) {
        mexErrMsgTxt("Incorrect number of inputs.");
    } else if( nlhs > 1 ) {
        mexErrMsgTxt("Too many output arguments.");
    }
    
        
    plhs[0] = mxCreateNumericArray( 2, td, mxDOUBLE_CLASS, mxREAL);
    status = mxGetPr(plhs[0]);    
    *status = (double ) _main( );  
    return;
}
"""

eyelink_data_stop.mx_c.mdoc = \
"""function [ status ] = mx_eyelink_data_stop( )
%MX_EYELINK_DATA_STOP Places tracker in idle (off-line) mode, does not flush 
% data from queue.
%
% Remarks:
% Should be followed by a call to eyelink_wait_for_mode_ready().
% Returns:
% 0 if command sent OK, else link error.
%
"""
eyelink_data_stop.write_c()
eyelink_data_stop.write_m()
eyelink_data_stop.compile()
eyelink_data_stop.write_sh()

